<?php

//$http_method = strtoupper($_SERVER['REQUEST_METHOD']);

$user_id = get_loggedin_userid();
$url = urldecode(get_input('url',''));
$rating = urldecode(get_input('rating',0));

if($url === ''){
    echo json_encode(array("status"=>500, "message" => "url can not be empty!"));
    exit;
}

$ok = GgsSocialObjects::doRating($user_id, $url, $rating);

if($ok ){
	echo json_encode(array("status"=>200, "message" => "ok"));
    exit; 
} 
echo json_encode(array("status"=>500, "message" => "fail"));
exit; 